using MediatR;

namespace TerritoryGame.Application.Queries;

public record GetRoomsQuery : IRequest<GetRoomsResult>;

public record GetRoomsResult
{
    public bool Success { get; init; }
    public string? ErrorMessage { get; init; }
    public List<RoomInfo> Rooms { get; init; } = new();
}

public record RoomInfo
{
    public Guid Id { get; init; }
    public string Name { get; init; } = string.Empty;
    public string RoomCode { get; init; } = string.Empty; // 添加房间代码
    public string? Password { get; init; }
    public int MaxPlayers { get; init; }
    public int PlayerCount { get; init; }
    public string Status { get; init; } = string.Empty;
    public int GameDuration { get; init; }
    public DateTime CreatedAt { get; init; }
    public bool HasPassword => !string.IsNullOrEmpty(Password);
}
